Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
@babel/plugin-transform-numeric-separator
Advanced tools
Remove numeric separators from Decimal, Binary, Hex and Octal literals
The @babel/plugin-transform-numeric-separator package allows developers to use numeric separators in their JavaScript code to improve readability of numeric literals. This plugin transforms these numeric literals with separators into standard numeric literals that can be understood by JavaScript engines that do not support this ES2021 feature.
Transforming large numeric literals
Improves readability of large numeric literals by allowing underscores as separators.
1000000000 // Before transformation
1_000_000_000 // After using @babel/plugin-transform-numeric-separator
Support for various numeric types
Allows numeric separators in binary, octal, and hexadecimal literals, enhancing clarity in different numeric systems.
0b1010_0101_1001 // binary
0o2_3_5_7 // octal
0xdead_beef // hexadecimal
TypeScript, a superset of JavaScript, supports numeric separators directly in the language without needing a transformation plugin. However, TypeScript offers a much broader set of features beyond numeric separators, including type checking and interfaces.
esbuild is a fast JavaScript bundler and minifier that supports transforming modern JavaScript features, including numeric separators, for compatibility with older environments. While it provides similar functionality in terms of numeric separators, esbuild is more focused on bundling and building performance.
Remove numeric separators from Decimal, Binary, Hex and Octal literals
See our website @babel/plugin-transform-numeric-separator for more information.
Using npm:
npm install --save-dev @babel/plugin-transform-numeric-separator
or using yarn:
yarn add @babel/plugin-transform-numeric-separator --dev
v7.25.8 (2024-10-10)
babel-core
resolvePlugin
/resolvePreset
(@nicolo-ribaudo)babel-parser
, babel-plugin-proposal-async-do-expressions
, babel-plugin-proposal-destructuring-private
, babel-plugin-proposal-do-expressions
, babel-plugin-proposal-explicit-resource-management
, babel-plugin-proposal-export-default-from
, babel-plugin-proposal-function-bind
, babel-plugin-proposal-function-sent
, babel-plugin-proposal-import-defer
, babel-plugin-proposal-partial-application
, babel-plugin-proposal-throw-expressions
, babel-plugin-transform-async-generator-functions
, babel-plugin-transform-class-static-block
, babel-plugin-transform-dynamic-import
, babel-plugin-transform-export-namespace-from
, babel-plugin-transform-json-strings
, babel-plugin-transform-logical-assignment-operators
, babel-plugin-transform-nullish-coalescing-operator
, babel-plugin-transform-numeric-separator
, babel-plugin-transform-object-rest-spread
, babel-plugin-transform-optional-catch-binding
, babel-plugin-transform-optional-chaining
, babel-plugin-transform-private-property-in-object
, babel-preset-env
FAQs
Remove numeric separators from Decimal, Binary, Hex and Octal literals
The npm package @babel/plugin-transform-numeric-separator receives a total of 16,440,150 weekly downloads. As such, @babel/plugin-transform-numeric-separator popularity was classified as popular.
We found that @babel/plugin-transform-numeric-separator demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.